//
//  HWAdvertisementView.m
//  嗨文
//
//  Created by 响当当 on 2019/1/10.
//  Copyright © 2019年 dongzheng. All rights reserved.
//

#import "HWAdvertisementView.h"

@interface HWAdvertisementView ()
@property (nonatomic, strong) UIImageView *AdvertisementImageView;//广告
@property (nonatomic, strong) UIButton *clickBtn;//广告点击
@end

@implementation HWAdvertisementView

- (UIImageView *)AdvertisementImageView
{
    if (!_AdvertisementImageView)
    {
        _AdvertisementImageView = [[UIImageView alloc] initWithFrame:self.bounds];
        _AdvertisementImageView.image = [UIImage imageNamed:@"Adv"];
    }
    return _AdvertisementImageView;
}

- (UIButton *)clickBtn
{
    if (!_clickBtn)
    {
        _clickBtn = [HWUtilties creatButtonWithFrame:self.bounds
                                        textAligment:NSTextAlignmentLeft
                                                text:nil
                                            textClor:nil
                                           buttonBGC:[UIColor clearColor]
                                            textFont:0
                                              target:self
                                              method:@selector(click)];
    }
    return _clickBtn;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self addSubview:self.AdvertisementImageView];
        [self addSubview:self.clickBtn];
    }
    return self;
}

- (void)getAdvertisementImage:(NSString *)url
{
    
}

#pragma mark - 广告跳转
- (void)click
{
    [HWUtilties pushWebWithUrl:@"http://www.haishuwu.com/bookTokenTask" title:@"我的书券"toUrl:nil toId:nil];
}
@end

